//
//  btree.hpp
//  CppDemo
//
//  Created by 蒋益杰 on 2017/5/21.
//  Copyright © 2017年 com.ed. All rights reserved.
//

#ifndef btree_hpp
#define btree_hpp

#include <iostream>
#include "STLUsage.hpp"

class BiTree {
private:
    TreeNode *root;
    void insert(TreeNode * &root, int x);
    bool search(TreeNode * &root, const int x);
    void remove(TreeNode * &root, const int x);
    void display(TreeNode * &root);
    
public:
    BiTree();
    void insert(int x);
    bool search(int x);
    void remove(const int x);
    void display();
    
    void inorder();
    void preorder();
    void postorder();
};

#endif /* btree_hpp */
